#ifndef __FILTER_H
#define __FILTER_H

typedef struct __KalmanFilter {
    float LastP;        /* P(k-1|k-1)*/
    float NewP;         /* P(k|k-1) */
    float Kg;           /* 卡尔曼增益 */
    float Out;          /* X(k|k-1)*/
    float Q;            /* 预测噪声 */
    float R;            /* 测量噪声 */
} KalmanFilter_t;

float KalmanFilter(KalmanFilter_t *EKF, float input);
float Complementary_Filter(float x1, float x2, float x1_factor);

#endif
